<?php

abstract class AbstractHCObject
{
    public $m_asParam = array();
    
    
    public function __construct()
    {
    }
    
    /**
     * Assigne la valeur $psValue à la clé $psName
     * 
     * @param String $psName
     * @param Mixed $psValue
     * @return void
     */
    public function setParam($psName, $psValue)
    {
        if (CSDebug::assertEmpty($psName)) return false;
        
        $this->m_asParam[$psName] = $psValue;
    }
    
    
    /**
     * Traite un tableau de paramètres
     * @param $pasArray
     */
    public function configure($pasArray)
    {
        if (CSDebug::assertArray($pasArray)) return false;
        
        foreach ($pasArray as $sName => $sValue)
            $this->setParam($sName, $sValue);
    }
    
    
    public function getDisplay()
    {
        return json_encode($this->m_asParam);
    }
    
    
    public function getData()
    {
        return $this->m_asParam;
    }
    
    
    public function tokenize($psString)
    {
        $sToken = hash('md5', $psString);
        
        CHCChart::$sm_asTokenizer[$sToken] = $psString;

        return $sToken; 
    }
}